<%--
  - Author		:	Jaewon Choi
  - Date			:
  - Description	:	
  --%>
<%@ page language="java" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/pages/includes/taglibs.jspf" %>
<%@ include file="/WEB-INF/pages/includes/variables.jspf" %>
<%@ include file="/WEB-INF/pages/includes/doctype.jspf" %>
<html>
	<head>
<%@ include file="/WEB-INF/pages/includes/metatags.jspf" %>
		<title><fmt:message key="pages.title" /></title>
		<link rel="stylesheet" type="text/css" href="<c:url value="${dirStyles}/common.css" />" />
		<link rel="stylesheet" type="text/css" href="<c:url value="${dirScripts}/jqueryUi/css/ui-lightness/jquery-ui-1.8.21.custom.css" />" />

		<script type="text/javascript" src="<c:url value="${dirScripts}/jquery-1.7.2.min.js" />"></script>
		<script type="text/javascript" src="<c:url value="${dirScripts}/jquery-ui-1.8.21.custom.min.js" />"></script>
		<script type="text/javascript">
			$(function(){
			});
		</script>
	</head>
	<body>
		<div class="bodyWrap">
<%@ include file="/WEB-INF/pages/includes/header.jsp" %>
<%@ include file="/WEB-INF/pages/includes/left.jsp" %>
			<div class="contWrap">
				<div class="menuTitle">
					Android푸시메시지 > 상세보기
				</div>
				<form id="frm" name="frm" method="post" action="<c:url value="/gcm/form.do" />">
					<input type="hidden" name="maxnum" value="${param.maxnum}" />
					<input type="hidden" name="page" value="${param.page}" />
					<input type="hidden" name="searchDate" value="${param.searchDate}">
					<input type="hidden" name="searchBeginTime" value="${param.searchBeginTime}" /> 
					<input type="hidden" name="searchEndTime" value="${param.searchEndTime}" />
					<input type="hidden" name="idx" value="${gcm.idx}">
					
					<table class="frmTbl">
						<colgroup>
							<col width="130px;" />
							<col width="*" />
						</colgroup>
						<tbody>
							<tr>
								<th>상태</th>
								<td>
									<c:choose>
										<c:when test="${gcm.status eq -1}">발송실패</c:when>
										<c:when test="${gcm.status eq 0}">발송준비</c:when>
										<c:when test="${gcm.status eq 1}">발송대기</c:when>
										<c:when test="${gcm.status eq 2}">발송완료</c:when>
										<c:otherwise>
											${gcm.status}
										</c:otherwise>
									</c:choose>
								</td>
							</tr>
							<tr>
								<th>기간</th>
								<td>
									<c:catch var="e">
										<fmt:parseDate var="sendTime" pattern="yyyy-MM-dd HH:mm:ss" value="${gcm.sendTime}" />
										<fmt:formatDate value="${sendTime}" pattern="yyyy-MM-dd HH:mm:ss" />
									</c:catch>
									<c:if test="${not empty e}">
										${gcm.sendTime}
									</c:if>
								</td>
							</tr>
							<tr>
								<th>제목</th>
								<td>
									<c:out value="${gcm.title}" />
								</td>
							</tr>
							<c:forEach var="gcmData" items="${gcmDataList}">
								<c:choose>
									<c:when test="${gcmData.key eq 'subtitle'}">
										<c:set var="subtitle" value="${gcmData.data}" />
									</c:when>
									<c:when test="${gcmData.key eq 'message'}">
										<c:set var="message" value="${gcmData.data}" />
									</c:when>
								</c:choose>
							</c:forEach>
							<tr>
								<th>알림바 문구</th>
								<td>
									<c:out value="${subtitle}" />
								</td>
							</tr>
							<tr>
								<th>내용</th>
								<td>
									<c:out value="${message}" />
								</td>
							</tr>
						</tbody>
					</table>
					<input type="button" class="btn" value="목록" onclick="javascript:document.listFrm.submit();" />
					<input type="submit" class="btn" value="수정" />
				</form>
				<form name="listFrm" action="<c:url value="/gcm/list.do" />" method="post" style="display: none;">
					<input type="hidden" name="maxnum" value="${param.maxnum}" />
					<input type="hidden" name="page" value="${param.page}" />
					<input type="hidden" name="searchDate" value="${param.searchDate}">
					<input type="hidden" name="beginTime" value="${param.searchBeginTime}" /> 
					<input type="hidden" name="endTime" value="${param.searchEndTime}" />
				</form>
			</div>
<%@ include file="/WEB-INF/pages/includes/footer.jsp" %>
		</div>
	</body>
</html> 